/**
 * @author LKQ
 * @date 2022/2/25 12:11
 * @description 位运算
 */
public class FormalSolution {
    public static void main(String[] args) {

    }
    public int countPoints(String rings) {
        // 表示10个杆
        int[] poles = new int[10];
        for (int i = 0; i < rings.length(); i += 2) {
            int index = rings.charAt(i + 1) - '0';
            if (rings.charAt(i) == 'R') {
                poles[index] |= 1;
            } else if (rings.charAt(i) == 'G') {
                poles[index] |= 2;
            } else {
                poles[index] |= 4;
            }
        }

        // 统计
        int ans = 0;
        for (int i = 0; i < 10; i++) {
            if (poles[i] == 7) {
                ans++;
            }
        }

        return ans;
    }
}
